import { debug } from './env'
export default ({ mock, setup }) => {
  if (mock !== false && debug)
    setup()
}
export const successResponseWrap = (data) => {
  return {
    data,
    status: 'ok',
    message: '请求成功',
    code: 200,
  }
}
export const failResponseWrap = (data, code = 500, message) => {
  return {
    data,
    status: 'fail',
    message,
    code,
  }
}